package com.appinterfacelite.controller;

import com.appinterfacelite.service.impl.PermissionServiceImpl;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    PermissionServiceImpl permissionService;

    @GetMapping("/permissionNodeId")
    @ResponseBody
    public JSONObject permissionNodeId(String userId, String token) {
        JSONObject jsonObject = permissionService.permissionNodeId(userId,token);
        return jsonObject;
    }

    @PostMapping("/updateHomeuser")
    @ResponseBody
    public JSONObject updateHomeuser(@RequestBody String bodyparam) {
        JSONObject jsonObject = permissionService.updateHomeuser(bodyparam);
        return jsonObject;
    }
}
